#include <bits/stdc++.h>
using namespace std;

class people{
public:
	int no;
	int time;
	bool operator<(people a){
		return a.time<=this->time;
	}
};

int main(void){
	double n=0;
	double sum;
	people a[1005];
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i].time;
		a[i].no=i+1;
	}
	sort(a,a+(int)n);
	for(int i=n-1;i>=0;i--){
		cout<<a[i].no;
		if(i!=0)cout<<' ';
		sum+=a[i].time*i;
	}
	printf("\n%.2lf",sum/n);
	return 0;
}
